<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<link rel="stylesheet" type="text/css" href="../css/lib.css">
<script src="../js/lib-all.js"></script>
<style>
body{TEXT-ALIGN: center;}
.c{ MARGIN-RIGHT: auto;MARGIN-LEFT: auto;}
</style>
</head>
<body>
<div class="c">
<form>
 <div class="media-inline" data-component="uploadify" data-uri="/uploadify">
        <input size="100" type="file" class="J_upload" attach-type="shop:cover"/>
        <input type="hidden" name="img" class="J_val" />
      </div>
</form>
</div>
</body>

<script>
$(document).ready(function($){
  $("*[data-component='uploadify']").each(function(i){
					var $this = $(this),
					     $fileInput = $('.J_upload',$this),
					     $valout = $('input.J_val',$this),
					     uploadUrl = $this.attr('data-uri');
					$fileInput.ajaxUploader({
				        action_url: uploadUrl,
				        input_name: 'img',
				        onSubmit: function(id, fileName){},
				        onFinish: function(fileName){
						  $valout.val(fileName);
				        }
				    });
				});
});
</script>
</html>


